package main

import (
	"demo/template"
	"fmt"
	"net"
	"net/http"
	"time"
)

func main() {
	httpServer := http.Server{
		Addr:         ":8080",
		Handler:      &template.TempHandler{},
		ReadTimeout:  10 * time.Second,
		WriteTimeout: 10 * time.Second,
	}

	listener, err := net.Listen("tcp", httpServer.Addr)
	if err != nil {
		panic(err)
	}
	fmt.Println("start http server")
	err = httpServer.Serve(listener)
	if err != nil {
		panic(err)
	}
}
